package nz;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectDB {
    // 数据库连接URL，根据实际情况修改主机地址、端口、数据库名等信息
    private static final String URL = "jdbc:mysql://localhost:3306/LibraryManagementSystem";
    // 替换为你的MySQL用户名
    private static final String USERNAME = "root";
    // 替换为你的MySQL密码
    private static final String PASSWORD = "123456";

    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection(URL, USERNAME, PASSWORD);
    }
}
